//For testing Performance of thread Must hard code into libraly user never see it's
// Auto create Thread by API
//var Thread = new AnimationThread("Thread");

var gen1 = new Genesis(0,0);
gen1.setSize(500,500);
document.documentElement.childNodes[1].appendChild(gen1.getDomObj());

var image1 = new BookImage("Gif_image.gif",100,100);
gen1.addComponent(image1);
image1.setLink("http://www.kapook.com",0);
// Add Animation
var anime1 = new AnimationContainer();

	// running in parallel
	anime1.addCommand('image1.moveImageTo(300,300,3)');
	anime1.addCommand('image1.fadeTo(0.2,1)');
	anime1.addCommand('image1.fadeTo(1,1)');

//	anime1.addCommand('image1.moveImageTo(10,300,1)');
//	anime1.addCommand('image1.reSizeTo(100,300,1)');
gen1.addCommand(anime1);

var anime11 = new AnimationContainer();
	anime11.addCommand('image1.reSizeTo(300,100,3)');
	//anime11.addCommand('image1.moveImageTo(100,100,1)');
gen1.addCommand(anime11);


var gen2 = new Genesis(500,0);
gen2.setSize(500,500);
document.documentElement.childNodes[1].appendChild(gen2.getDomObj());

var image2 = new BookImage("Gif_image.gif",100,100);
gen2.addComponent(image2);
image2.setLink("http://www.kapook.com",0);

// Add Animation
var anime2 = new AnimationContainer();
	// running in parallel
	anime2.addCommand('image2.moveImageTo(200,200,3)');
	anime2.addCommand('image2.moveImageTo(100,300,4)');
gen2.addCommand(anime2);



//Add timeout for all command success loading
//setTimeout('Thread.startThread()',500);

